package demo1.service;

import demo1.dao.UserDao;
import demo1.dao.UserMysqlDaoImp;
import demo1.dao.UserOrclDaoImp;
import demo1.dao.UserRedisDaoImp;
import demo1.fac.UserDaoFactory;

public class UserServiceImpl implements UserService {
//    UserDao dao = new UserMysqlDaoImp();
//    UserDao dao = new UserOrclDaoImp();
//    UserDao dao = new UserRedisDaoImp();

    UserDao dao ;//= UserDaoFactory.getInstace("orcl");  //IOC  控制反转

   /* public void setDao(UserDao dao) {
        this.dao = dao;
    }*/

    public UserServiceImpl(UserDao dao) {
        this.dao = dao;
    }

    @Override
    public int add() {
        return dao.add();
    }
}
